package homework;

public class PerfectNum {
	public static void main(String[] args) {
		int i,j,sum;//j是因子，sum是和
		for(i=1 ; i<=1000;i++) {
			sum=0;
			for(j=1;j<=i/2;j++) {
				if(i%j==0) {
					sum=sum+j;
				}
			}
			if(i==sum)
			System.out.println(i+" is PerfectNum");
		
		}
		
	}

}
